Skip to content

docs: dev note for workflow chaining#775

Open
andreatgretel wants to merge 3 commits into
mainfrom
andreatgretel/docs/hitl-document-extraction
Open

docs: dev note for workflow chaining#775
andreatgretel wants to merge 3 commits into
mainfrom
andreatgretel/docs/hitl-document-extraction

Conversation

@andreatgretel

Copy link
Copy Markdown
Contributor

📋 Summary

Adds a dev note and runnable recipe for workflow chaining as a pause/inspect/resume control surface. The post focuses on what named stage boundaries enable, including human review, reusable intermediate artifacts, downstream resume, and future workflow shapes.

🔗 Related Issue

N/A

🔄 Changes

  • Adds the "Pause, Inspect, Resume" dev note with hero/diagram/result assets for the workflow chaining story.
  • Adds a headless document review gate recipe that runs to review_candidates, writes a reviewed artifact, and resumes downstream from that artifact.
  • Adds the recipe page, recipe card, dev note card, and Fern navigation entry.
  • Adds tests covering page generation, review artifact creation, and the end-to-end recipe output.
  • Compresses large PNG assets below the pre-commit 600 KB limit; the workflow chaining diagram now uses a clean no-grid background.

🧪 Testing

  • .venv/bin/ruff check .
  • .venv/bin/ruff format --check .
  • .venv/bin/pytest packages/data-designer/tests/docs/test_document_review_gate_recipe.py
  • env npm_config_cache=/private/tmp/npm-cache-datadesigner make check-fern-docs (0 errors, 1 existing Fern warning)

✅ Checklist

  • Follows commit message conventions
  • Commits are signed off (DCO)
  • Architecture docs updated (N/A - docs/recipe only)

@github-actions

Copy link
Copy Markdown
Contributor

Fern preview: https://nvidia-preview-pr-775.docs.buildwithfern.com/nemo/datadesigner

Fern previews include the docs-website version archive with PR changes synced into latest. Notebook tutorials are rendered without execution outputs in previews.

@andreatgretel andreatgretel changed the title docs: add workflow chaining review gate docs: dev note for workflow chaining Jun 26, 2026
Comment thread fern/versions/latest/pages/devnotes/posts/annotate-hard-pages-review-gates.mdx Outdated

In that shape, `quality_gate` is both a normal stage and a contract. Upstream work promises a schema. Downstream work consumes that schema. A reviewer, evaluator, dashboard, or cleanup script only has to preserve the contract.

![Linear workflow chain showing source rows, named stages, a durable stage boundary, and downstream resume](/assets/document-hitl/workflow-chaining-linear-chain.png)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something seems off here....
Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is GitHub's rendered diff resolving Fern's root-relative /assets/... path against github.com. The tracked image is valid and renders in the Fern preview, so I kept the established Fern asset path.

Signed-off-by: Andre Manoel <amanoel@nvidia.com>
@andreatgretel andreatgretel marked this pull request as ready for review July 7, 2026 20:46
@andreatgretel andreatgretel requested a review from a team as a code owner July 7, 2026 20:46
@greptile-apps

greptile-apps Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a workflow chaining dev note and runnable document review gate recipe. The main changes are:

  • New headless recipe for pause, inspect, and resume workflow chaining.
  • New Fern recipe page, dev note page, cards, navigation, and image assets.
  • ResumeMode exported through the config package for documented dd.ResumeMode usage.
  • Tests for page generation, review artifact creation, recipe output, artifact reuse, and non-positive record counts.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
docs/assets/recipes/workflow_chaining/document_review_gate.py Adds the runnable review gate recipe and handles the main artifact reuse and non-positive record-count paths.
packages/data-designer-config/src/data_designer/config/run_config.py Defines ResumeMode in the config package for public config-layer access.
packages/data-designer-config/src/data_designer/config/init.py Adds ResumeMode to the config package lazy exports.
packages/data-designer-engine/src/data_designer/engine/storage/artifact_storage.py Uses the config-layer ResumeMode while keeping the old module-level import name available.
packages/data-designer/src/data_designer/interface/init.py Updates the interface lazy export target for ResumeMode.
packages/data-designer/tests/docs/test_document_review_gate_recipe.py Adds tests for the new recipe flow and its key CLI/artifact edge cases.

Reviews (2): Last reviewed commit: "docs: address workflow chaining feedback" | Re-trigger Greptile

Comment thread docs/assets/recipes/workflow_chaining/document_review_gate.py
Comment thread docs/assets/recipes/workflow_chaining/document_review_gate.py Outdated
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Thanks for putting this together, @andreatgretel — this is a genuinely nice dev note, and the runnable recipe makes the workflow-chaining story concrete.

Summary

This is a docs + recipe PR: it adds the "Pause, Inspect, Resume" dev note, a headless document_review_gate recipe that runs a workflow to a named review_candidates stage, exports the intermediate artifact, simulates an external review, and resumes downstream via stage_output_overrides. It also wires up the Fern navigation, recipe card, dev-note card, a redirect, compressed PNG assets, and behavioral tests. The implementation matches the stated intent, and I verified the workflow-chaining APIs it leans on (compose_workflow, add_stage, run(targets=…, resume=…, stage_output_overrides=…), export_stage, ResumeMode, custom_column_generator, CustomColumnConfig) all exist and are used with correct signatures.

Findings

Suggestions — Take it or leave it

docs/assets/recipes/workflow_chaining/document_review_gate.py:497-499 — Fallback indexes into ground_truth_boxes[0] without a guard

  • What: When every proposed box is dropped (the signature-skip branch removes the only box), the fallback does parse_boxes(row["ground_truth_boxes"])[0]. If a row ever had zero ground-truth boxes, this would raise IndexError.
  • Why: In this recipe every generated page always has several labeled boxes, so it can't trigger today — but as a reusable, copy-pasteable recipe it's the kind of edge a reader might hit after swapping in their own seed data.
  • Suggestion: A one-line guard (e.g. skip the row or fall back to [] when ground_truth_boxes is empty) would make the pattern safer to lift. Optional given the demo scope.

docs/assets/recipes/workflow_chaining/document_review_gate.py:119_font return annotation is slightly imprecise

  • What: The annotation is ImageFont.ImageFont, but ImageFont.truetype(...) returns a FreeTypeFont and only the load_default() fallback returns ImageFont.
  • Why: Purely cosmetic — callers only use draw.text/textbbox, which accept both. Flagging only for accuracy.
  • Suggestion: Leave as-is, or widen to the shared base if you want it exact. Not worth churn.

fern/docs.yml:37 — Redirect from a slug that was never published

  • What: The new redirect maps /dev-notes/annotate-the-hard-pages/dev-notes/pause-inspect-resume. Since this dev note is brand new (its slug resolves to pause-inspect-resume), there doesn't appear to be a prior public URL at annotate-the-hard-pages.
  • Why: A redirect for a URL that was never live is harmless but adds a little config noise and can be confusing later ("what used to be here?").
  • Suggestion: If the post was previously shared under that slug (draft/preview link), keep it; otherwise it can probably be dropped. Your call.

What Looks Good

  • The dev note is well-structured and honest — the "Why not just run two workflows?" table draws the operational distinction clearly, and the recipe stays "deliberately ordinary Data Designer," which reinforces the declarative contract nicely.
  • Tests verify behavior, not plumbing — asserting image dimensions, metadata validity, box-in-bounds geometry, selected-row counts, and source == "human_review" counts through the full run is exactly the right altitude for a recipe test. The spec_from_file_location loader for a non-importable script is a clean touch.
  • Slug/nav/card consistency checks out — the BlogCard href (/dev-notes/pause-inspect-resume), the recipe card, the nav entry, and the recipe-page cross-link all line up with Fern's title-derived slugs.

Notes

  • I couldn't re-run ruff check / ruff format --check in this CI environment (ruff isn't on PATH here). The PR checklist indicates they passed locally, and CI will enforce them regardless.
  • Two existing inline comments already raise (a) whether ResumeMode should live in data_designer.config so recipes can use dd.ResumeMode, and (b) whether conditional generation could achieve the same result within one stage. I'm not duplicating those — they're worth a reply from you, but neither blocks this docs/recipe PR.

Structural Impact (graphify, 2.4s)

Risk: LOW (localized change)

  • 2 Python files, 0 AST entities, 0/82 clusters

This confirms a localized, additive change with no god-node or cross-package blast radius — consistent with a docs + standalone-recipe PR that imports the public API surface without modifying it.

Verdict

Ship it (with nits) — Only optional suggestions above; nothing blocking. Worth a quick reply to the two existing inline comments before merge, but the change itself is in good shape.


This review was generated by an AI assistant.

Signed-off-by: Andre Manoel <amanoel@nvidia.com>
@andreatgretel

Copy link
Copy Markdown
Contributor Author

Addressed the remaining actionable bot feedback:

  • Metadata validation now rejects empty ground-truth box sets with a page-specific error.
  • Removed the redirect that was introduced with the unpublished article.
  • Kept the _font annotation unchanged because it is cosmetic and widening only the return annotation would remain incomplete.

Validation: 294 tests passed, Ruff passed, and Fern reported 0 errors with 1 existing warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants